<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="x-ua-compatible" content="ie=7" />
	<TITLE>会员安全设置：i友邻</TITLE>
  <link rel="stylesheet" type="text/css" href="${cpath}/css/gloabl.css"/>
	<link rel="stylesheet" type="text/css" href="${cpath}/css/oper.css" />
	<link rel="stylesheet" type="text/css" href="${cpath}/css/user.css">
	
	<SCRIPT src="${cpath}/js/location.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/location_array.js" type=text/javascript></SCRIPT>
	<script type="text/javascript" src="${cpath}/js/pophelp.js"></script>

</head>
<body>
<script> 
	//转页面
	var userID = '${userID}';
	if((userID == "")||(userID == null)){
		parent.window.location.replace("${cpath}/index.jsp"); 
	}
</script>

 	<!-- 页首 {{{ -->
	<%@ include file="/userhead.jsp"%>

	<div id="cont">

	<!-- 左边菜单栏 {{{ -->
	<%@ include file="/leftmenu.jsp"%>

	<div id="right">

		<!-- 右侧宽栏 {{{ -->
		<DIV class=profile_mid>
		<DIV class=content><!-- 右侧宽栏 }}}-->
		<div id="section-header">
				<ul id="nav-secondary">
					<li id="nav-on"><a href="#" ><span>修改登录密码</span></a></li>
				</ul>
				<ul class="related-links">
					<li class="last"><img src="${cpath}/images/icon_help.png" alt="Help" title="Help"></li> 
				</ul>
		</div>
		<!--  {{{  -->
		<UL class=top>
			<LI><STRONG>&nbsp;</STRONG>&nbsp;&nbsp;
				<SPAN><a ></a></SPAN>	
			</LI>
		</UL><!--   }}}-->
 			<form action="${cpath}/users.do" name="theForm"  method="post" enctype="multipart/form-data" >

			<UL class=detailinfo>
				<LI><STRONG>旧密码:</STRONG><EM>
					<input type="password" name='oldpwd' maxlength="8" value='' class="short"/></EM></LI>
				<LI><STRONG>新密码:</STRONG><EM>
					<input type="password" name='newpwd' maxlength="8" value='' class="short"/>&nbsp;*密码长度6－8位</EM></LI>
				<LI><STRONG>重输密码:</STRONG><EM>
					<input type="password" name='repwd' maxlength="8" value='' class="short"/></EM></LI>
				<!--隐藏域-->
				<input type="hidden" name='userID'		value='${theForm.userID}'/>
				<input type="hidden" name='nick'			value='${theForm.nick}'/>
				<input type="hidden" name='certtype'	value='${theForm.certtype}'/>
				<input type="hidden" name='certno'		value='${theForm.certno}'/>
				<input type="hidden" name='email'			value='${theForm.email}'/>
				<input type="hidden" name='password'	value='${theForm.password}'/>
				<input type="hidden" name='status'		value='${theForm.status}'/>
				<input type="hidden" name='type'			value='${theForm.type}'/>
				<input type="hidden" name='CTime'			value='${theForm.CTime}'/>
				<input type="hidden" name='loginCnt'	value='${theForm.loginCnt}'/>
				<input type="hidden" name='LTime'			value='${theForm.LTime}'/>
				<input type="hidden" name='online'		value='${theForm.online}'/>
				<input type="hidden" name='action'		value='${theForm.action}'/>
			</form>
			</UL><!--结束 }}}-->
			<UL class=detailinfo>
			<li class=btn>	
				<input type="button" name="save"  id="save" onclick="javascript:doConfirm();" class="shortBtn" value="保   存"/>&nbsp;
			</li>
			</UL>

		</DIV>
		</DIV><!--  }}} -->

	  <div class="right" style="margin-right:0px; ">
		<%@ include file="/righthead.jsp"%>
		</div>

	</DIV><!--  right end}}} -->

</DIV><!--  cont end}}} -->
</body>
</html>
<!---->
<script>

  /**
   * 检查项目资料维护
   */
	function doConfirm()
	{
		var form = document.theForm;

		var oldpwd = form['oldpwd'];
		var newpwd = form['newpwd'];
		var password = form['password'];
		var repwd = form['repwd'];
		var action = form['action'];

		if(oldpwd.value == ""||oldpwd.value != password.value)
		{
			alert("旧密码不正确");
			oldpwd.select();
			return false;
		}
		if (newpwd.value == "" || newpwd.value.replace(/(^\s*)|(\s*$)/g,"").length < 6 || password.value.length > 8)
		{
			alert("【新密码】不能为空或长度不符合规范\n");
			newpwd.focus();
			return false;
		}

		if (newpwd.value != repwd.value)
		{
			alert("【重输密码】与新密码不一致\n");
			repwd.focus();
			return false;
		}
		password.value = newpwd.value;

    form.submit();
	}

	/**
     * 根据具体请求设置各个组件状态	
     */
    function showState()
	{
		var action = '${action}';
		var form = document.theForm;		

		form['action'].value = 'updpwd';

	}
	showState();


</script>

